package by.grsu.crs.model;

import java.util.List;

//FIXME: all notes below are applicable for the each class in this package

//FIXME:I think that interface is redundant for DB objects(entities). It is not required but it will be better to remove interfaces on such classes. Are you sure that you will have any profit using interfaces here?
public class Car implements ICar {
	private int id;
	private final String registrationNumber;
	private final String model;
	private String description;

	// FIXME: do you really have this list in table "car"? I think NO! You
	// should have 2 separate packages with classes. 1st - DB entities (all
	// classes are mirrors of tables in DB). 2nd - models (similar classes with
	// the same attributes, but some additional attributes/methods can present).
	// It can be difficult to understand if you see it for the first time. Open
	// Irina's project and investigate classes related to User. You will see
	// separate "entity", "model", "dao", service. Try to understand and use the
	// same approach. Ask via email additional questions
	private List<String> photoUrls;
	private boolean available;
	private int price;

	// FIXME: don't use constructors with large set of parameters. 1-3
	// parameters - NOT MORE. Use empty constructor(or constructor with "id") to
	// create object and then use "set" methods to fill data
	public Car(final String registrationNumber, final String model, final String description, final List<String> photoUrls, final boolean available,
			final int price) {
		super();
		this.registrationNumber = registrationNumber;
		this.model = model;
		this.description = description;
		this.photoUrls = photoUrls;
		this.setAvailable(available);
		this.price = price;
	}

	public Car(final int id, final String registrationNumber, final String model, final String description, final List<String> photoUrls,
			final boolean available, final int price) {
		super();
		this.id = id;
		this.registrationNumber = registrationNumber;
		this.model = model;
		this.description = description;
		this.photoUrls = photoUrls;
		this.setAvailable(available);
		this.price = price;
	}

	public String getRegistrationNumber() {
		return registrationNumber;
	}

	public String getModel() {
		return model;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(final String description) {
		this.description = description;
	}

	public List<String> getPhotoUrls() {
		return photoUrls;
	}

	public void setPhotoUrls(final List<String> photoUrls) {
		this.photoUrls = photoUrls;
	}

	public int getId() {
		return id;
	}

	public int getPrice() {
		return price;
	}

	public void setPrice(final int price) {
		this.price = price;
	}

	public boolean isAvailable() {
		return available;
	}

	public void setAvailable(final boolean available) {
		this.available = available;
	}
}
